package com.tgpms.web.assets.dao;

import com.tgpms.util.PageView;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.tgpms.web.assets.entity.FaTransfer;
import com.tgpms.web.assets.entity.FaTransferKey;

import java.util.List;

/**
* 表FA_TRANSFER -> D8003固定资产转移 的基本功能实现
*
* @author newway
* @createDate 2019/08/09
*/
public interface FaTransferMapper {
    /**
     * D8003固定资产转移  deleteByPrimaryKey 实现
     * 
     * @param key
     * @return null int
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    int deleteByPrimaryKey(FaTransferKey key);

    /**
     * D8003固定资产转移  insert 实现
     * 
     * @param record
     * @return null int
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    int insert(FaTransfer record);

    /**
     * D8003固定资产转移  insertSelective 实现
     * 
     * @param record
     * @return null int
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    int insertSelective(FaTransfer record);

    /**
     * D8003固定资产转移  selectByPrimaryKey 实现
     * 
     * @param key
     * @return null com.tgpms.web.assets.entity.FaTransfer
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    FaTransfer selectByPrimaryKey(FaTransferKey key);

    /**
     * D8003固定资产转移  faTransferNo 实现
     *
     * @param fixedAssetNo
     * @return null com.tgpms.web.assets.entity.FaTransfer
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    List<FaTransfer> selectByTransferNo(String fixedAssetNo);

    List<FaTransfer> queryByCondition(@Param("pageView") PageView pageView);
    /**
     * D8003固定资产转移  updateByPrimaryKeySelective 实现
     * 
     * @param record
     * @return null int
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    int updateByPrimaryKeySelective(FaTransfer record);

    /**
     * D8003固定资产转移  updateByPrimaryKey 实现
     * 
     * @param record
     * @return null int
     * @author: newway
     * @createDate: 2019-08-09 17:16:41
     */
    int updateByPrimaryKey(FaTransfer record);
    
    //查询最大主键数值
    @Select("select MAX(FA_TRANSFER_NO) from FA_TRANSFER where FIXED_ASSET_NO=#{fixedAssetNo}")
    String getMaxPrimaryKey(@Param("fixedAssetNo")String fixedAssetNo);
    
}